Merged
Conversation
Contributor
Author
cfallin
approved these changes
Jul 12, 2023
Member
cfallin
left a comment
There was a problem hiding this comment.
Thanks a bunch -- this will be really useful to have!
| let mut checker = Checker::new(&function, function.machine_env()); | ||
| checker.prepare(&output); | ||
| if let Err(e) = checker.run() { | ||
| panic!("Regsiter allocation checker failed: {e:#?}"); |
| impl SerializableFunction { | ||
| /// Creates a new `SerializableFunction` from an arbitray `Function` and | ||
| /// `MachineEnv`. | ||
| pub fn new(func: &impl Function, machine_env: MachineEnv) -> Self { |
Member
There was a problem hiding this comment.
Should the second arg be a &MachineEnv? Alternately, no clone two lines below?
This PR has 2 components: - A `SerializableFunction` which wraps a `Function` and `MachineEnv`. This type can be serialized and deserialized with Serde, and is enabled by the "enable-serde" feature. - A `regalloc2-tool` binary which reads a bincode-encoded `SerializableFunction` and then runs the register allocator and checker on it. This is a useful tool for debugging register allocation failures and to investigate cases of poor register allocation.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR has 2 components:
SerializableFunctionwhich wraps aFunctionandMachineEnv. This type can be serialized and deserialized with Serde, and is enabled by the "enable-serde" feature.regalloc2-toolbinary which reads a bincode-encodedSerializableFunctionand then runs the register allocator and checker on it.This is a useful tool for debugging register allocation failures and to investigate cases of poor register allocation.